package cn.fourhundredandeighteen.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * subject
 * @author 
 */
public class Subject implements Serializable {
    /**
     * 比赛id
     */
    private Long subjectId;

    /**
     * 比赛名称
     */
    private String subjectName;

    /**
     * 获得几等奖
     */
    private String subjectGrade;

    /**
     * 比赛级别
     */
    private Integer subjectLevel;

    /**
     * 比赛类别
     */
    private String subjectCategory;

    /**
     * 关联比赛成员个数
     */
    private Integer subjectCount;

    /**
     * 比赛时间
     */
    private Date subjectTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    private static final long serialVersionUID = 1L;

    public Long getSubjectId() {
        return subjectId;
    }

    public void setSubjectId(Long subjectId) {
        this.subjectId = subjectId;
    }

    public String getSubjectName() {
        return subjectName;
    }

    public void setSubjectName(String subjectName) {
        this.subjectName = subjectName;
    }

    public String getSubjectGrade() {
        return subjectGrade;
    }

    public void setSubjectGrade(String subjectGrade) {
        this.subjectGrade = subjectGrade;
    }

    public Integer getSubjectLevel() {
        return subjectLevel;
    }

    public void setSubjectLevel(Integer subjectLevel) {
        this.subjectLevel = subjectLevel;
    }

    public String getSubjectCategory() {
        return subjectCategory;
    }

    public void setSubjectCategory(String subjectCategory) {
        this.subjectCategory = subjectCategory;
    }

    public Integer getSubjectCount() {
        return subjectCount;
    }

    public void setSubjectCount(Integer subjectCount) {
        this.subjectCount = subjectCount;
    }

    public Date getSubjectTime() {
        return subjectTime;
    }

    public void setSubjectTime(Date subjectTime) {
        this.subjectTime = subjectTime;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Subject other = (Subject) that;
        return (this.getSubjectId() == null ? other.getSubjectId() == null : this.getSubjectId().equals(other.getSubjectId()))
            && (this.getSubjectName() == null ? other.getSubjectName() == null : this.getSubjectName().equals(other.getSubjectName()))
            && (this.getSubjectGrade() == null ? other.getSubjectGrade() == null : this.getSubjectGrade().equals(other.getSubjectGrade()))
            && (this.getSubjectLevel() == null ? other.getSubjectLevel() == null : this.getSubjectLevel().equals(other.getSubjectLevel()))
            && (this.getSubjectCategory() == null ? other.getSubjectCategory() == null : this.getSubjectCategory().equals(other.getSubjectCategory()))
            && (this.getSubjectCount() == null ? other.getSubjectCount() == null : this.getSubjectCount().equals(other.getSubjectCount()))
            && (this.getSubjectTime() == null ? other.getSubjectTime() == null : this.getSubjectTime().equals(other.getSubjectTime()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getSubjectId() == null) ? 0 : getSubjectId().hashCode());
        result = prime * result + ((getSubjectName() == null) ? 0 : getSubjectName().hashCode());
        result = prime * result + ((getSubjectGrade() == null) ? 0 : getSubjectGrade().hashCode());
        result = prime * result + ((getSubjectLevel() == null) ? 0 : getSubjectLevel().hashCode());
        result = prime * result + ((getSubjectCategory() == null) ? 0 : getSubjectCategory().hashCode());
        result = prime * result + ((getSubjectCount() == null) ? 0 : getSubjectCount().hashCode());
        result = prime * result + ((getSubjectTime() == null) ? 0 : getSubjectTime().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", subjectId=").append(subjectId);
        sb.append(", subjectName=").append(subjectName);
        sb.append(", subjectGrade=").append(subjectGrade);
        sb.append(", subjectLevel=").append(subjectLevel);
        sb.append(", subjectCategory=").append(subjectCategory);
        sb.append(", subjectCount=").append(subjectCount);
        sb.append(", subjectTime=").append(subjectTime);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}